﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VerificationChecklist.aspx.cs" Inherits="CRMWeb.Pages.VerificationChecklist" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>

    <link rel="stylesheet" type="text/css" href="/EasyUI/Themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="/EasyUI/Themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="/Css/CrmStyle.css" />
    <script type="text/javascript" src="/Scripts/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="/EasyUI/jquery.easyui.min.js"></script>
</head>
<body>

    <form id="form1" runat="server">
        <div style="text-align: right; padding: 15px; position: relative;">
            <a id="lnkbtnAddCheckitem" href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-add" onclick="$('#dlgExtraChecklistItem').dialog('open').dialog('setTitle', 'Add extra checklist item');">Add CheckItem</a>
        </div>
        <div data-options="region:'west',split:true,border:false" style="width: auto; padding: 5px;">
            <table style="width: 100%;">
                <tr>
                    <td style="vertical-align: top">
                        <table style="width: 100%; border-right: 5px solid #E6EEF8">
                            <tr>
                                <td colspan="2" style="text-align: center;">
                                    <strong>Income</strong>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 30%; vertical-align: top">
                                    <asp:CheckBox ID="chkCenterLink1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkCenterLink2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkCenterLink3" runat="server" onclick="JavaScript:formDataChange();" />

                                </td>
                                <td>Payslips/Centerlink
                                </td>
                            </tr>
                            <tr>
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkbankst1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkbankst2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkbankst3" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top;">Bank Statement</td>
                            </tr>
                            <tr>
                                <td style="vertical-align: top"></td>
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chk2mnths1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chk2mnths2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chk2mnths3" runat="server" onclick="JavaScript:formDataChange();" />&nbsp; 2 Months
                                </td>
                            </tr>
                            <tr>
                                <td style="vertical-align: top"></td>
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkFullName1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkFullName2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkFullName3" runat="server" onclick="JavaScript:formDataChange();" />&nbsp; Full Name
                                </td>
                            </tr>
                            <tr>
                                <td style="vertical-align: top"></td>
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkBSB1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkBSB2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkBSB3" runat="server" onclick="JavaScript:formDataChange();" />&nbsp; A/C BSB
                                </td>
                            </tr>
                            <tr id="trExtraItemNo1" runat="server" style="display: none;">
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkExtraItemNo11" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo12" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo13" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">
                                    <asp:Label ID="lblExtraItemName1" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr id="trExtraItemNo2" runat="server" style="display: none;">
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkExtraItemNo21" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo22" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo23" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">
                                    <asp:Label ID="lblExtraItemName2" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr id="trExtraItemNo3" runat="server" style="display: none;">
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkExtraItemNo31" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo32" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo33" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">
                                    <asp:Label ID="lblExtraItemName3" runat="server"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td style="vertical-align: top">
                        <table style="width: 100%; border-right: 5px solid #E6EEF8">
                            <tr>
                                <td colspan="2" style="text-align: center;">
                                    <strong>Asset</strong>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 40%; vertical-align: top">
                                    <asp:CheckBox ID="chkVehicles1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkVehicles2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkVehicles3" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">Vehicles(VIN)
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="text-align: center;">
                                    <strong>Property</strong>
                                </td>
                            </tr>
                            <tr>
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkCouncilRate1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkCouncilRate2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkCouncilRate3" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">Council Rate
                                </td>
                            </tr>
                            <tr>
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkMortage1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkMortage2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkMortage3" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">Mortage
                                </td>
                            </tr>
                            <tr>
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkValuation1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkValuation2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkValuation3" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">Valuation/Appraisal
                                </td>
                            </tr>
                            <tr id="trExtraItemNo4" runat="server" style="display: none;">
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkExtraItemNo41" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo42" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo43" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">
                                    <asp:Label ID="lblExtraItemName4" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr id="trExtraItemNo5" runat="server" style="display: none;">
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkExtraItemNo51" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo52" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo53" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">
                                    <asp:Label ID="lblExtraItemName5" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr id="trExtraItemNo6" runat="server" style="display: none;">
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkExtraItemNo61" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo62" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo63" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">
                                    <asp:Label ID="lblExtraItemName6" runat="server"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td style="vertical-align: top">
                        <table style="width: 100%; border-right: 5px solid #E6EEF8">
                            <tr>
                                <td colspan="2" style="text-align: center;">
                                    <strong>Residential</strong>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 40%; vertical-align: top">
                                    <asp:CheckBox ID="chkRentalReceipt1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkRentalReceipt2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkRentalReceipt3" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">Rental Receipt/Agt
                                </td>
                            </tr>
                            <tr>
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkRate1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkRate2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkRate3" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">Rate
                                </td>
                            </tr>
                            <tr>
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkBoarding1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkBoarding2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkBoarding3" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">Boarding
                                </td>
                            </tr>
                            <tr>
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkBills1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkBills2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkBills3" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">Bills
                                </td>
                            </tr>
                            <tr id="trExtraItemNo7" runat="server" style="display: none;">
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkExtraItemNo71" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo72" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo73" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">
                                    <asp:Label ID="lblExtraItemName7" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr id="trExtraItemNo8" runat="server" style="display: none;">
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkExtraItemNo81" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo82" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo83" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">
                                    <asp:Label ID="lblExtraItemName8" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="height: 16px"></td>
                            </tr>
                        </table>
                    </td>
                    <td style="vertical-align: top">
                        <table style="width: 100%;">
                            <tr>
                                <td colspan="2" style="text-align: center;">
                                    <strong>IDs</strong>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 30%; vertical-align: top">
                                    <asp:CheckBox ID="chkPassport1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkPassport2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkPassport3" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">Driver/Password/Photo ID
                                </td>
                            </tr>
                            <tr>
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkCard1" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkCard2" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkCard3" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">Medicare Card/Bank
                                </td>
                            </tr>
                            <tr id="trExtraItemNo9" runat="server" style="display: none;">
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkExtraItemNo91" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo92" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo93" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">
                                    <asp:Label ID="lblExtraItemName9" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr id="trExtraItemNo10" runat="server" style="display: none;">
                                <td style="vertical-align: top">
                                    <asp:CheckBox ID="chkExtraItemNo101" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo102" runat="server" onclick="JavaScript:formDataChange();" />&nbsp;
                                    <asp:CheckBox ID="chkExtraItemNo103" runat="server" onclick="JavaScript:formDataChange();" />
                                </td>
                                <td style="vertical-align: top">
                                    <asp:Label ID="lblExtraItemName10" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="height: 16px"></td>
                            </tr>
                            <tr>
                                <td colspan="2" style="height: 16px"></td>
                            </tr>
                            <tr>
                                <td colspan="2" style="height: 16px"></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <input type="hidden" id="hdnApplicationContactID1" runat="server" />
            <input type="hidden" id="hdnApplicationContactID2" runat="server" />
            <input type="hidden" id="hdnApplicationContactID3" runat="server" />
            <input type="hidden" id="hdntotalApplicant" runat="server" />

            <input id="hdnExtraItemNo11" runat="server" type="hidden" />
            <input id="hdnExtraItemNo12" runat="server" type="hidden" />
            <input id="hdnExtraItemNo13" runat="server" type="hidden" />
            <input id="hdnExtraItemNo21" runat="server" type="hidden" />
            <input id="hdnExtraItemNo22" runat="server" type="hidden" />
            <input id="hdnExtraItemNo23" runat="server" type="hidden" />
            <input id="hdnExtraItemNo31" runat="server" type="hidden" />
            <input id="hdnExtraItemNo32" runat="server" type="hidden" />
            <input id="hdnExtraItemNo33" runat="server" type="hidden" />
            <input id="hdnExtraItemNo41" runat="server" type="hidden" />
            <input id="hdnExtraItemNo42" runat="server" type="hidden" />
            <input id="hdnExtraItemNo43" runat="server" type="hidden" />
            <input id="hdnExtraItemNo51" runat="server" type="hidden" />
            <input id="hdnExtraItemNo52" runat="server" type="hidden" />
            <input id="hdnExtraItemNo53" runat="server" type="hidden" />
            <input id="hdnExtraItemNo61" runat="server" type="hidden" />
            <input id="hdnExtraItemNo62" runat="server" type="hidden" />
            <input id="hdnExtraItemNo63" runat="server" type="hidden" />
            <input id="hdnExtraItemNo71" runat="server" type="hidden" />
            <input id="hdnExtraItemNo72" runat="server" type="hidden" />
            <input id="hdnExtraItemNo73" runat="server" type="hidden" />
            <input id="hdnExtraItemNo81" runat="server" type="hidden" />
            <input id="hdnExtraItemNo82" runat="server" type="hidden" />
            <input id="hdnExtraItemNo83" runat="server" type="hidden" />
            <input id="hdnExtraItemNo91" runat="server" type="hidden" />
            <input id="hdnExtraItemNo92" runat="server" type="hidden" />
            <input id="hdnExtraItemNo93" runat="server" type="hidden" />
            <input id="hdnExtraItemNo101" runat="server" type="hidden" />
            <input id="hdnExtraItemNo102" runat="server" type="hidden" />
            <input id="hdnExtraItemNo103" runat="server" type="hidden" />

            <input id="hdnExtraItem1" runat="server" type="hidden" />
            <input id="hdnExtraItem2" runat="server" type="hidden" />
            <input id="hdnExtraItem3" runat="server" type="hidden" />
            <input id="hdnExtraItem4" runat="server" type="hidden" />
            <input id="hdnExtraItem5" runat="server" type="hidden" />
            <input id="hdnExtraItem6" runat="server" type="hidden" />
            <input id="hdnExtraItem7" runat="server" type="hidden" />
            <input id="hdnExtraItem8" runat="server" type="hidden" />
            <input id="hdnExtraItem9" runat="server" type="hidden" />
            <input id="hdnExtraItem10" runat="server" type="hidden" />


        </div>
        <br />

        <div id="dlgExtraChecklistItem" class="easyui-dialog" style="width: 460px; height: 250px; padding: 10px 20px" closed="true" buttons="#dlg-buttons">
            <div class="ftitle">History Information</div>

            <div class="fitem">
                <label style="width: 130px;">Type:</label>
                <select id="cmbitemtype" class="easyui-combobox" data-options="panelHeight:'auto'" name="Action" style="width: 200px;" required="true">
                    <option value="Income">Income</option>
                    <option value="Assert">Assert</option>
                    <option value="Residential">Residential</option>
                    <option value="IDs">IDs</option>
                </select>
            </div>
            <div class="fitem">
                <label style="width: 130px;">Item Name:</label>
                <input id="txtitemname" name="HistoryTime" class="easyui-validatebox" style="width: 200px;" required="true" />
            </div>

        </div>
        <div id="dlg-buttons">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-ok" onclick="saveExtraItem()">Add</a>
        </div>
    </form>
    <script type="text/javascript">

        $(document).ready(function () {
            $('#ContentPlaceHolder1_appProfile_hdnVerification').val('true');
        });
        function showPrompt() {
            return 'You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?';
        }
        function formDataChange() {
            window.onbeforeunload = showPrompt;
        }
        $(document).keydown(function (event) {
            if ((event.which == 83 || event.which == 115) && (event.ctrlKey || event.metaKey) || (event.which == 19)) {
                event.preventDefault();
                // UpdateApplicantDatas();
                return false;
            }

            return true;
        });

        function saveExtraItem() {
            var itype = $('#cmbitemtype').combobox('getValue');
            var iname = $('#txtitemname').val();
            if (itype != '' && iname != '') {
                $.ajax({
                    url: '/WebServices/ExtraChecklistItem.ashx?method=ExtraChecklistItemAdd',
                    contentType: 'application/json; charset=utf-8',
                    data: { 'ItemType': itype, 'ItemName': iname, 'app_id': getQuerystring("app_id", null), 'ApplicationContactID': $('#hdnApplicationContactID').val() },
                    success: function (returnVal) {
                        if (returnVal == 0) {
                            $('#dlgExtraChecklistItem').dialog('close');
                            $('#cmbitemtype').combobox('setValue', '');
                            $('#txtitemname').val('');
                            alert('Record not exists in Verification Checklist');
                        }
                        else {
                            $('#dlgExtraChecklistItem').dialog('close');
                            $('#cmbitemtype').combobox('setValue', '');
                            $('#txtitemname').val('');
                            // alert('Extra Item Added Successfully');
                            if (itype == 'Income') {
                                if ($("#trExtraItemNo1").css('display') === 'none') {
                                    $("#trExtraItemNo1").show();
                                    $('#chkExtraItemNo11').prop('checked', true);
                                    $('#chkExtraItemNo12').prop('checked', true);
                                    $('#chkExtraItemNo13').prop('checked', true);
                                    $('#hdnExtraItemNo11').val(returnVal);
                                    $('#hdnExtraItemNo12').val(returnVal);
                                    $('#hdnExtraItemNo13').val(returnVal);
                                    $('#lblExtraItemName1').html(iname);
                                }
                                else if ($("#trExtraItemNo2").css('display') === 'none') {
                                    $("#trExtraItemNo2").show();
                                    $('#chkExtraItemNo21').prop('checked', true);
                                    $('#chkExtraItemNo22').prop('checked', true);
                                    $('#chkExtraItemNo23').prop('checked', true);
                                    $('#hdnExtraItemNo21').val(returnVal);
                                    $('#hdnExtraItemNo22').val(returnVal);
                                    $('#hdnExtraItemNo23').val(returnVal);
                                    $('#lblExtraItemName2').html(iname);
                                }
                                else if ($("#trExtraItemNo3").css('display') === 'none') {
                                    $("#trExtraItemNo3").show();
                                    $('#chkExtraItemNo31').prop('checked', true);
                                    $('#chkExtraItemNo32').prop('checked', true);
                                    $('#chkExtraItemNo33').prop('checked', true);
                                    $('#hdnExtraItemNo31').val(returnVal);
                                    $('#hdnExtraItemNo32').val(returnVal);
                                    $('#hdnExtraItemNo33').val(returnVal);
                                    $('#lblExtraItemName3').html(iname);
                                }
                            }
                            else if (itype == 'Assert') {
                                if ($("#trExtraItemNo4").css('display') === 'none') {
                                    $("#trExtraItemNo4").show();
                                    $('#chkExtraItemNo41').prop('checked', true);
                                    $('#chkExtraItemNo42').prop('checked', true);
                                    $('#chkExtraItemNo43').prop('checked', true);
                                    $('#hdnExtraItemNo41').val(returnVal);
                                    $('#hdnExtraItemNo42').val(returnVal);
                                    $('#hdnExtraItemNo43').val(returnVal);
                                    $('#lblExtraItemName4').html(iname);
                                }
                                else if ($("#trExtraItemNo5").css('display') === 'none') {
                                    $("#trExtraItemNo5").show();
                                    $('#chkExtraItemNo51').prop('checked', true);
                                    $('#chkExtraItemNo52').prop('checked', true);
                                    $('#chkExtraItemNo53').prop('checked', true);

                                    $('#hdnExtraItemNo51').val(returnVal);
                                    $('#hdnExtraItemNo52').val(returnVal);
                                    $('#hdnExtraItemNo53').val(returnVal);
                                    $('#lblExtraItemName5').html(iname);
                                }
                                else if ($("#trExtraItemNo6").css('display') === 'none') {
                                    $("#trExtraItemNo6").show();
                                    $('#chkExtraItemNo61').prop('checked', true);
                                    $('#chkExtraItemNo62').prop('checked', true);
                                    $('#chkExtraItemNo63').prop('checked', true);

                                    $('#hdnExtraItemNo61').val(returnVal);
                                    $('#hdnExtraItemNo62').val(returnVal);
                                    $('#hdnExtraItemNo63').val(returnVal);
                                    $('#lblExtraItemName6').html(iname);
                                }
                            }
                            else if (itype == 'Residential') {
                                if ($("#trExtraItemNo7").css('display') === 'none') {
                                    $("#trExtraItemNo7").show();
                                    $('#chkExtraItemNo71').prop('checked', true);
                                    $('#chkExtraItemNo72').prop('checked', true);
                                    $('#chkExtraItemNo73').prop('checked', true);
                                    $('#hdnExtraItemNo71').val(returnVal);
                                    $('#hdnExtraItemNo72').val(returnVal);
                                    $('#hdnExtraItemNo73').val(returnVal);

                                    $('#lblExtraItemName7').html(iname);
                                }
                                else if ($("#trExtraItemNo8").css('display') === 'none') {
                                    $("#trExtraItemNo8").show();
                                    $('#hdnExtraItemNo81').val(returnVal);
                                    $('#hdnExtraItemNo82').val(returnVal);
                                    $('#hdnExtraItemNo83').val(returnVal);
                                    $('#chkExtraItemNo81').prop('checked', true);
                                    $('#chkExtraItemNo82').prop('checked', true);
                                    $('#chkExtraItemNo83').prop('checked', true);

                                    $('#lblExtraItemName8').html(iname);
                                }
                            }
                            else if (itype == 'IDs') {
                                if ($("#trExtraItemNo9").css('display') === 'none') {
                                    $("#trExtraItemNo9").show();
                                    $('#chkExtraItemNo91').prop('checked', true);
                                    $('#chkExtraItemNo92').prop('checked', true);
                                    $('#chkExtraItemNo93').prop('checked', true);

                                    $('#hdnExtraItemNo91').val(returnVal);
                                    $('#hdnExtraItemNo92').val(returnVal);
                                    $('#hdnExtraItemNo93').val(returnVal);
                                    $('#lblExtraItemName9').html(iname);
                                }
                                else if ($("#trExtraItemNo10").css('display') === 'none') {
                                    $("#trExtraItemNo10").show();
                                    $('#chkExtraItemNo101').prop('checked', true);
                                    $('#chkExtraItemNo102').prop('checked', true);
                                    $('#chkExtraItemNo103').prop('checked', true);
                                    $('#hdnExtraItemNo101').val(returnVal);
                                    $('#hdnExtraItemNo102').val(returnVal);
                                    $('#hdnExtraItemNo103').val(returnVal);
                                    $('#lblExtraItemName10').html(iname);
                                }
                            }
                            UpdateApplicantDatas();
                        }
                    }
                });
            }
        }

        $("#chkExtraItemNo11").click(function () {
            if (!$('#chkExtraItemNo11').prop('checked')) {
                $('#hdnExtraItemNo11').val('');
            }
            else {
                $('#hdnExtraItemNo11').val($('#hdnExtraItem1').val());
            }
        });
        $("#chkExtraItemNo12").click(function () {
            if (!$('#chkExtraItemNo12').prop('checked')) {
                $('#hdnExtraItemNo12').val('');
            }
            else {
                $('#hdnExtraItemNo12').val($('#hdnExtraItem1').val());
            }
        });
        $("#chkExtraItemNo13").click(function () {
            if (!$('#chkExtraItemNo13').prop('checked')) {
                $('#hdnExtraItemNo13').val('');
            }
            else {
                $('#hdnExtraItemNo13').val($('#hdnExtraItem1').val());
            }
        });
        $("#chkExtraItemNo21").click(function () {
            if (!$('#chkExtraItemNo21').prop('checked')) {
                $('#hdnExtraItemNo21').val('');
            }
            else {
                $('#hdnExtraItemNo21').val($('#hdnExtraItem2').val());
            }
        });
        $("#chkExtraItemNo22").click(function () {
            if (!$('#chkExtraItemNo22').prop('checked')) {
                $('#hdnExtraItemNo22').val('');
            }
            else {
                $('#hdnExtraItemNo22').val($('#hdnExtraItem2').val());
            }
        });
        $("#chkExtraItemNo23").click(function () {
            if (!$('#chkExtraItemNo23').prop('checked')) {
                $('#hdnExtraItemNo23').val('');
            }
            else {
                $('#hdnExtraItemNo23').val($('#hdnExtraItem2').val());
            }
        });
        $("#chkExtraItemNo31").click(function () {
            if (!$('#chkExtraItemNo31').prop('checked')) {
                $('#hdnExtraItemNo31').val('');
            }
            else {
                $('#hdnExtraItemNo31').val($('#hdnExtraItem3').val());
            }
        });
        $("#chkExtraItemNo32").click(function () {
            if (!$('#chkExtraItemNo32').prop('checked')) {
                $('#hdnExtraItemNo32').val('');
            }
            else {
                $('#hdnExtraItemNo32').val($('#hdnExtraItem3').val());
            }
        });
        $("#chkExtraItemNo33").click(function () {
            if (!$('#chkExtraItemNo33').prop('checked')) {
                $('#hdnExtraItemNo33').val('');
            }
            else {
                $('#hdnExtraItemNo33').val($('#hdnExtraItem3').val());
            }
        });
        $("#chkExtraItemNo41").click(function () {
            if (!$('#chkExtraItemNo41').prop('checked')) {
                $('#hdnExtraItemNo41').val('');
            }
            else {
                $('#hdnExtraItemNo41').val($('#hdnExtraItem4').val());
            }
        });
        $("#chkExtraItemNo42").click(function () {
            if (!$('#chkExtraItemNo42').prop('checked')) {
                $('#hdnExtraItemNo42').val('');
            }
            else {
                $('#hdnExtraItemNo42').val($('#hdnExtraItem4').val());
            }
        });
        $("#chkExtraItemNo43").click(function () {
            if (!$('#chkExtraItemNo43').prop('checked')) {
                $('#hdnExtraItemNo43').val('');
            }
            else {
                $('#hdnExtraItemNo43').val($('#hdnExtraItem4').val());
            }
        });
        $("#chkExtraItemNo51").click(function () {
            if (!$('#chkExtraItemNo51').prop('checked')) {
                $('#hdnExtraItemNo51').val('');
            }
            else {
                $('#hdnExtraItemNo51').val($('#hdnExtraItem5').val());
            }
        });
        $("#chkExtraItemNo52").click(function () {
            if (!$('#chkExtraItemNo52').prop('checked')) {
                $('#hdnExtraItemNo52').val('');
            }
            else {
                $('#hdnExtraItemNo52').val($('#hdnExtraItem5').val());
            }
        });
        $("#chkExtraItemNo53").click(function () {
            if (!$('#chkExtraItemNo53').prop('checked')) {
                $('#hdnExtraItemNo53').val('');
            }
            else {
                $('#hdnExtraItemNo53').val($('#hdnExtraItem5').val());
            }
        });
        $("#chkExtraItemNo61").click(function () {
            if (!$('#chkExtraItemNo61').prop('checked')) {
                $('#hdnExtraItemNo61').val('');
            }
            else {
                $('#hdnExtraItemNo61').val($('#hdnExtraItem6').val());
            }
        });
        $("#chkExtraItemNo62").click(function () {
            if (!$('#chkExtraItemNo62').prop('checked')) {
                $('#hdnExtraItemNo62').val('');
            }
            else {
                $('#hdnExtraItemNo62').val($('#hdnExtraItem6').val());
            }
        });
        $("#chkExtraItemNo63").click(function () {
            if (!$('#chkExtraItemNo63').prop('checked')) {
                $('#hdnExtraItemNo63').val('');
            }
            else {
                $('#hdnExtraItemNo63').val($('#hdnExtraItem6').val());
            }
        });
        $("#chkExtraItemNo71").click(function () {
            if (!$('#chkExtraItemNo71').prop('checked')) {
                $('#hdnExtraItemNo71').val('');
            }
            else {
                $('#hdnExtraItemNo71').val($('#hdnExtraItem7').val());
            }
        });
        $("#chkExtraItemNo72").click(function () {
            if (!$('#chkExtraItemNo72').prop('checked')) {
                $('#hdnExtraItemNo72').val('');
            }
            else {
                $('#hdnExtraItemNo72').val($('#hdnExtraItem7').val());
            }
        });
        $("#chkExtraItemNo73").click(function () {
            if (!$('#chkExtraItemNo73').prop('checked')) {
                $('#hdnExtraItemNo73').val('');
            }
            else {
                $('#hdnExtraItemNo73').val($('#hdnExtraItem7').val());
            }
        });
        $("#chkExtraItemNo81").click(function () {
            if (!$('#chkExtraItemNo81').prop('checked')) {
                $('#hdnExtraItemNo81').val('');
            }
            else {
                $('#hdnExtraItemNo81').val($('#hdnExtraItem8').val());
            }
        });
        $("#chkExtraItemNo82").click(function () {
            if (!$('#chkExtraItemNo82').prop('checked')) {
                $('#hdnExtraItemNo82').val('');
            }
            else {
                $('#hdnExtraItemNo82').val($('#hdnExtraItem8').val());
            }
        });
        $("#chkExtraItemNo83").click(function () {
            if (!$('#chkExtraItemNo83').prop('checked')) {
                $('#hdnExtraItemNo83').val('');
            }
            else {
                $('#hdnExtraItemNo83').val($('#hdnExtraItem8').val());
            }
        });
        $("#chkExtraItemNo91").click(function () {
            if (!$('#chkExtraItemNo91').prop('checked')) {
                $('#hdnExtraItemNo91').val('');
            }
            else {
                $('#hdnExtraItemNo91').val($('#hdnExtraItem9').val());
            }
        });
        $("#chkExtraItemNo92").click(function () {
            if (!$('#chkExtraItemNo92').prop('checked')) {
                $('#hdnExtraItemNo92').val('');
            }
            else {
                $('#hdnExtraItemNo92').val($('#hdnExtraItem9').val());
            }
        });
        $("#chkExtraItemNo93").click(function () {
            if (!$('#chkExtraItemNo93').prop('checked')) {
                $('#hdnExtraItemNo93').val('');
            }
            else {
                $('#hdnExtraItemNo93').val($('#hdnExtraItem9').val());
            }
        });
        $("#chkExtraItemNo101").click(function () {
            if (!$('#chkExtraItemNo101').prop('checked')) {
                $('#hdnExtraItemNo101').val('');
            }
            else {
                $('#hdnExtraItemNo101').val($('#hdnExtraItem10').val());
            }
        });
        $("#chkExtraItemNo102").click(function () {
            if (!$('#chkExtraItemNo102').prop('checked')) {
                $('#hdnExtraItemNo102').val('');
            }
            else {
                $('#hdnExtraItemNo102').val($('#hdnExtraItem10').val());
            }
        });
        $("#chkExtraItemNo103").click(function () {
            if (!$('#chkExtraItemNo103').prop('checked')) {
                $('#hdnExtraItemNo103').val('');
            }
            else {
                $('#hdnExtraItemNo103').val($('#hdnExtraItem10').val());
            }
        });
        //First Checkbox End Condition
        //If any of one checkbox is unchecked then do bank statement checkbox also do unchecked.(For 1st checkbox of bank statement.)
        $("#chk2mnths2").click(function () {
            if (($('#chk2mnths1').prop('checked')) && ($('#chkFullName1').prop('checked')) && ($('#chkBSB1').prop('checked'))) {
                $('#chkbankst1').prop('checked', true);
            }
            else {
                $('#chkbankst1').prop('checked', false);
            }
        });
        $("#chkFullName1").click(function () {
            if (($('#chk2mnths1').prop('checked')) && ($('#chkFullName1').prop('checked')) && ($('#chkBSB1').prop('checked'))) {
                $('#chkbankst1').prop('checked', true);
            }
            else {
                $('#chkbankst1').prop('checked', false);
            }
        });
        $("#chkBSB1").click(function () {
            if (($('#chk2mnths1').prop('checked')) && ($('#chkFullName1').prop('checked')) && ($('#chkBSB1').prop('checked'))) {
                $('#chkbankst1').prop('checked', true);
            }
            else {
                $('#chkbankst1').prop('checked', false);
            }
        });
        //Second Bank Statement Checkbox End Condition
        //If any of one checkbox is unchecked then do bank statement checkbox also do unchecked.(For 2st checkbox of bank statement.)
        $("#chk2mnths2").click(function () {
            if (($('#chk2mnths2').prop('checked')) && ($('#chkFullName2').prop('checked')) && ($('#chkBSB2').prop('checked'))) {
                $('#chkbankst2').prop('checked', true);
            }
            else {
                $('#chkbankst2').prop('checked', false);
            }
        });
        $("#chkFullName2").click(function () {
            if (($('#chk2mnths2').prop('checked')) && ($('#chkFullName2').prop('checked')) && ($('#chkBSB2').prop('checked'))) {
                $('#chkbankst2').prop('checked', true);
            }
            else {
                $('#chkbankst2').prop('checked', false);
            }
        });
        $("#chkBSB2").click(function () {
            if (($('#chk2mnths2').prop('checked')) && ($('#chkFullName2').prop('checked')) && ($('#chkBSB2').prop('checked'))) {
                $('#chkbankst2').prop('checked', true);
            }
            else {
                $('#chkbankst2').prop('checked', false);
            }
        });

        //Third Bank Statement Checkbox End Condition

        //If any of one checkbox is unchecked then do bank statement checkbox also do unchecked.(For 3rd checkbox of bank statement.)
        $("#chk2mnths3").click(function () {
            if (($('#chk2mnths3').prop('checked')) && ($('#chkFullName3').prop('checked')) && ($('#chkBSB3').prop('checked'))) {
                $('#chkbankst3').prop('checked', true);
            }
            else {
                $('#chkbankst3').prop('checked', false);
            }
        });
        $("#chkFullName3").click(function () {
            if (($('#chk2mnths3').prop('checked')) && ($('#chkFullName3').prop('checked')) && ($('#chkBSB3').prop('checked'))) {
                $('#chkbankst3').prop('checked', true);
            }
            else {
                $('#chkbankst3').prop('checked', false);
            }
        });
        $("#chkBSB3").click(function () {
            if (($('#chk2mnths3').prop('checked')) && ($('#chkFullName3').prop('checked')) && ($('#chkBSB3').prop('checked'))) {
                $('#chkbankst3').prop('checked', true);
            }
            else {
                $('#chkbankst3').prop('checked', false);
            }
        });

        $("#chkbankst1").click(function () {
            if ($('#chkbankst1').prop('checked')) {
                $('#chk2mnths1').prop('checked', true);
                $('#chkFullName1').prop('checked', true);
                $('#chkBSB1').prop('checked', true);
            }
            else {
                $('#chk2mnths1').prop('checked', false);
                $('#chkFullName1').prop('checked', false);
                $('#chkBSB1').prop('checked', false);
            }
        });

        $("#chkbankst2").click(function () {
            if ($('#chkbankst2').prop('checked')) {
                $('#chk2mnths2').prop('checked', true);
                $('#chkFullName2').prop('checked', true);
                $('#chkBSB2').prop('checked', true);
            }
            else {
                $('#chk2mnths2').prop('checked', false);
                $('#chkFullName2').prop('checked', false);
                $('#chkBSB2').prop('checked', false);
            }
        });

        $("#chkbankst3").click(function () {
            if ($('#chkbankst3').prop('checked')) {
                $('#chk2mnths3').prop('checked', true);
                $('#chkFullName3').prop('checked', true);
                $('#chkBSB3').prop('checked', true);
            }
            else {
                $('#chk2mnths3').prop('checked', false);
                $('#chkFullName3').prop('checked', false);
                $('#chkBSB3').prop('checked', false);
            }
        });

        //Function for update data if ctrl+s
        function UpdateApplicantDatas() {
            $.ajax({
                url: '/WebServices/VerificationChecklistApplicant.ashx?method=UpdateVerificationChecklist',
                type: 'POST',
                data: {
                    totalApplicant: $('#hdntotalApplicant').val(),
                    app_id: getQuerystring('app_id', 0), ApplicationContactID: $('#hdnApplicationContactID1').val(),
                    ApplicationContactID1: $('#hdnApplicationContactID2').val(), ApplicationContactID2: $('#hdnApplicationContactID3').val(),
                    Income_Payslip: $('#chkCenterLink1').is(":checked"),
                    Bank_LatestMonth: $('#chk2mnths1').is(":checked"), Bank_FullName: $('#chkFullName1').is(":checked"), Bank_ACBSB: $('#chkBSB1').is(":checked"),
                    Assert_Vehicles: $('#chkVehicles1').is(":checked"),
                    Assert_CouncilRate: $('#chkCouncilRate1').is(":checked"), Assert_Mortage: $('#chkMortage1').is(":checked"), Assert_Valuation: $('#chkValuation1').is(":checked"), IDs_Residential_Rental: $('#chkRentalReceipt1').is(":checked"),
                    Residential_Rate: $('#chkRate1').is(":checked"), Boarding: $('#chkBoarding1').is(":checked"), 'Bills': $('#chkBills1').is(":checked"), IDs_PhotoID: $('#chkPassport1').is(":checked"), IDs_Card: $('#chkCard1').is(":checked"),
                    ExtraItemNo11: $('#hdnExtraItemNo11').val(), ExtraItemNo21: $('#hdnExtraItemNo21').val(), ExtraItemNo31: $('#hdnExtraItemNo31').val(), ExtraItemNo41: $('#hdnExtraItemNo41').val(), ExtraItemNo51: $('#hdnExtraItemNo51').val(),
                    ExtraItemNo61: $('#hdnExtraItemNo61').val(), ExtraItemNo71: $('#hdnExtraItemNo71').val(), ExtraItemNo81: $('#hdnExtraItemNo81').val(), ExtraItemNo91: $('#hdnExtraItemNo91').val(), ExtraItemNo101: $('#hdnExtraItemNo101').val(),
                    Income_Payslip1: $('#chkCenterLink2').is(":checked"), Bank_LatestMonth1: $('#chk2mnths2').is(":checked"), Bank_FullName1: $('#chkFullName2').is(":checked"), Bank_ACBSB1: $('#chkBSB2').is(":checked"), Assert_Vehicles1: $('#chkVehicles2').is(":checked"),
                    Assert_CouncilRate1: $('#chkCouncilRate2').is(":checked"), Assert_Mortage1: $('#chkMortage2').is(":checked"), Assert_Valuation1: $('#chkValuation2').is(":checked"), IDs_Residential_Rental1: $('#chkRentalReceipt2').is(":checked"), Residential_Rate1: $('#chkRate2').is(":checked"),
                    Boarding1: $('#chkBoarding2').is(":checked"), Bills1: $('#chkBills2').is(":checked"), IDs_PhotoID1: $('#chkPassport2').is(":checked"), 'IDs_Card1': $('#chkCard2').is(":checked"), ExtraItemNo12: $('#hdnExtraItemNo12').val(), ExtraItemNo22: $('#hdnExtraItemNo22').val(),
                    ExtraItemNo32: $('#hdnExtraItemNo32').val(), ExtraItemNo42: $('#hdnExtraItemNo42').val(), ExtraItemNo52: $('#hdnExtraItemNo52').val(), 'ExtraItemNo62': $('#hdnExtraItemNo62').val(), ExtraItemNo72: $('#hdnExtraItemNo72').val(), ExtraItemNo82: $('#hdnExtraItemNo82').val(),
                    ExtraItemNo92: $('#hdnExtraItemNo92').val(), ExtraItemNo102: $('#hdnExtraItemNo102').val(), Income_Payslip2: $('#chkCenterLink3').is(":checked"), 'Bank_LatestMonth2': $('#chk2mnths3').is(":checked"), Bank_FullName2: $('#chkFullName3').is(":checked"),
                    Bank_ACBSB2: $('#chkBSB3').is(":checked"), Assert_Vehicles2: $('#chkVehicles3').is(":checked"), Assert_CouncilRate2: $('#chkCouncilRate3').is(":checked"), Assert_Mortage2: $('#chkMortage3').is(":checked"), Assert_Valuation2: $('#chkValuation3').is(":checked"),
                    IDs_Residential_Rental2: $('#chkRentalReceipt3').is(":checked"), Residential_Rate2: $('#chkRate3').is(":checked"), Boarding2: $('#chkBoarding3').is(":checked"), Bills2: $('#chkBills3').is(":checked"), IDs_PhotoID2: $('#chkPassport3').is(":checked"),
                    IDs_Card2: $('#chkCard3').is(":checked"), ExtraItemNo13: $('#hdnExtraItemNo13').val(), ExtraItemNo23: $('#hdnExtraItemNo23').val(), ExtraItemNo33: $('#hdnExtraItemNo33').val(), ExtraItemNo43: $('#hdnExtraItemNo43').val(), ExtraItemNo53: $('#hdnExtraItemNo53').val(),
                    ExtraItemNo63: $('#hdnExtraItemNo63').val(), ExtraItemNo73: $('#hdnExtraItemNo73').val(), ExtraItemNo83: $('#hdnExtraItemNo83').val(), ExtraItemNo93: $('#hdnExtraItemNo93').val(), ExtraItemNo103: $('#hdnExtraItemNo103').val(),
                    username: $('#ContentPlaceHolder1_appProfile_hdnUserName').val()
                },
                success: function (data) {
                }
            });
        }



    </script>
</body>
</html>
